import QtQuick 2.0

Rectangle {
    id:root
    width: 200
    height: 200
   color: Qt.rgba(255,255,0,1);
    property alias image_soure: im.source
    property alias text: text.text

    signal enter()
    state:focus?"clicked":""
    Image {
        id: im
        source: "../pics/mes.png"
        anchors.fill: parent
        anchors.margins: parent.width/6

    }
    Text {
        id: text
        anchors.horizontalCenter: im.horizontalCenter
        anchors.bottom:  root.bottom
        anchors.bottomMargin: 10
        font.pointSize: 12
        text: qsTr("User")
    }
    MouseArea{
        anchors.fill: parent
        onClicked: {
            parent.forceActiveFocus();
            parent.enter();
            //console.debug(window.index.toString());
        }
    }
    states: State {
        name: "clicked"
        PropertyChanges { target: root; color: "blue"; }
    }
    transitions: Transition {
        // Make the state changes smooth
        ParallelAnimation {
            ColorAnimation { property: "color"; duration: 100 }
        }
    }
}
